package com.example.mongodb1;


import java.util.Arrays;
import java.util.HashMap;
import java.util.Map;

public class MapValidate {
    public static void main(String[] args) {
       Map<String, Object> map = new HashMap<String, Object>();
       map.put("name", "杨通");
       map.put("age",18);
       map.put("hobby", Arrays.asList("篮球","football"));

        System.out.println(map.containsKey("name"));
        System.out.println(map.containsKey("name2"));
        Object name = map.get("age");
        System.out.println(name.getClass().equals(String.class));
        if(name.getClass().equals(String.class)){
            String name2 = (String) name;
            System.out.println(name2.trim().isEmpty());
        }

    }
}
